import ajax from "@/utils/request";

// 验证手机号是否被注册过
export function getCheckPhone(data: {tel: string}){
  return ajax({
    url: '/user/docheckphone',
    method: 'POST',
    data
  })
}

// 获取验证码的接口
export function getSendMsgCode(data: {tel: string}){
  return ajax({
    url: '/user/dosendmsgcode',
    method: 'POST',
    data
  })
}

// 验证，验证码是否正确的接口
export function getCheckCode(data: {tel: string,telcode: string}){
  return ajax({
    url: '/user/docheckcode',
    method: 'POST',
    data
  })
}

// 注册，设置密码
export function setPassword(data: {tel: string,password: string}){
  return ajax({
    url: '/user/dofinishregister',
    method: 'POST',
    data
  })
}


// 登录的接口
export function loginFn(data: {loginname: string, password: string}){
  return ajax({
    url: '/user/login',
    method: 'POST',
    data
  })
}
